package com.cswangdao.controller.admin;


import com.cswangdao.domain.vo.DashboardVo;
import com.cswangdao.result.Result;
import com.cswangdao.service.StatisticService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RequestMapping("/admin/dashboard")
@RestController
@Slf4j
public class AdminDashboardController {

    @Autowired
    private StatisticService statisticService;

    @GetMapping
    public Result<DashboardVo> doGet() {
        log.info("首页数据");
        DashboardVo dashboardVo = statisticService.getDashboard();
        return Result.success(dashboardVo);
    }
}
